/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package job.manager.db.ec;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "Address")
@NamedQueries({@NamedQuery(name = "AddressEB.findAll", query = "SELECT a FROM AddressEB a"), @NamedQuery(name = "AddressEB.findById", query = "SELECT a FROM AddressEB a WHERE a.id = :id"), @NamedQuery(name = "AddressEB.findByAddress1", query = "SELECT a FROM AddressEB a WHERE a.address1 = :address1"), @NamedQuery(name = "AddressEB.findByAddress2", query = "SELECT a FROM AddressEB a WHERE a.address2 = :address2"), @NamedQuery(name = "AddressEB.findByPostCode", query = "SELECT a FROM AddressEB a WHERE a.postCode = :postCode"), @NamedQuery(name = "AddressEB.findByCity", query = "SELECT a FROM AddressEB a WHERE a.city = :city"), @NamedQuery(name = "AddressEB.findByCountry", query = "SELECT a FROM AddressEB a WHERE a.country = :country"), @NamedQuery(name = "AddressEB.findByPhoneNumber", query = "SELECT a FROM AddressEB a WHERE a.phoneNumber = :phoneNumber"), @NamedQuery(name = "AddressEB.findByCellPhone", query = "SELECT a FROM AddressEB a WHERE a.cellPhone = :cellPhone"), @NamedQuery(name = "AddressEB.findByEmail", query = "SELECT a FROM AddressEB a WHERE a.email = :email"), @NamedQuery(name = "AddressEB.findByName", query = "SELECT a FROM AddressEB a WHERE a.name = :name"), @NamedQuery(name = "AddressEB.findByPid", query = "SELECT a FROM AddressEB a WHERE a.profileId.id = :proId")})
public class AddressEB implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "Address1")
    private String address1;
    @Column(name = "Address2")
    private String address2;
    @Basic(optional = false)
    @Column(name = "PostCode")
    private String postCode;
    @Basic(optional = false)
    @Column(name = "City")
    private String city;
    @Basic(optional = false)
    @Column(name = "Country")
    private String country;
    @Basic(optional = false)
    @Column(name = "PhoneNumber")
    private String phoneNumber;
    @Basic(optional = false)
    @Column(name = "CellPhone")
    private String cellPhone;
    @Basic(optional = false)
    @Column(name = "Email")
    private String email;
    @Lob
    @Column(name = "Comment")
    private String comment;
    @Basic(optional = false)
    @Column(name = "Name")
    private String name;
    @JoinColumn(name = "ProfileId", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private ProfilesEB profileId;

    public AddressEB() {
    }

    public AddressEB(Integer id) {
        this.id = id;
    }

    public AddressEB(Integer id, String address1, String address2, String postCode, String city, String country, String phoneNumber, String cellPhone, String email, String name, ProfilesEB p) {
        this.id = id;
        this.address1 = address1;
        this.address2 = address2;
        this.postCode = postCode;
        this.city = city;
        this.country = country;
        this.phoneNumber = phoneNumber;
        this.cellPhone = cellPhone;
        this.email = email;
        this.name = name;
        this.profileId = p;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getAddress1() {
        return address1;
    }

    public void setAddress1(String address1) {
        this.address1 = address1;
    }

    public String getAddress2() {
        return address2;
    }

    public void setAddress2(String address2) {
        this.address2 = address2;
    }

    public String getPostCode() {
        return postCode;
    }

    public void setPostCode(String postCode) {
        this.postCode = postCode;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getCellPhone() {
        return cellPhone;
    }

    public void setCellPhone(String cellPhone) {
        this.cellPhone = cellPhone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ProfilesEB getProfileId() {
        return profileId;
    }

    public void setProfileId(ProfilesEB profileId) {
        this.profileId = profileId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AddressEB)) {
            return false;
        }
        AddressEB other = (AddressEB) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "job.manager.db.ec.AddressEB[id=" + id + "]";
    }

}
